﻿using Microsoft.EntityFrameworkCore;
using WebAppTemplate.CSR.Repository.DbContexts;
using WebAppTemplate.CSR.Repository.Entities;

namespace WebAppTemplate.CSR.Service.QueryServices
{
    public interface IDemoQueryService
    {
        Task<List<Demo>> GetAll();
    }

    public class DemoQueryService
    {
        private readonly AppQueryContext _context;
        public DemoQueryService(AppQueryContext context) => _context = context;

        public async Task<List<Demo>> GetAll()
        {
            return await _context.Demo.ToListAsync();
        }
    }
}
